package student.web.internal;

import org.zkoss.zk.ui.Desktop;
import org.zkoss.zk.ui.util.DesktopCleanup;

import cloudspace.vm.VM;
import cloudspace.vm.io.console.CometUpdateThread;

public class DesktopLoggerCleanup implements DesktopCleanup
{

	@Override
	public void cleanup(Desktop desktop) throws Exception
	{
		desktop.enableServerPush(false);
		CometUpdateThread updateThread = (CometUpdateThread)desktop.getAttribute("cometThread");
		updateThread.setDone();
		VM.currentVM().removeDesktop(desktop.getId());
	}

}
